<?php
		require("../dbconnect.php");
		
		
		$id=$_GET['id'];
		
		$get_stock=mysql_query("select a.show_stock_quantity,a.promotion,a.promotion_target,a.id,b.pid,b.unit_price,b.promotion_price,b.retail_price,b.id as bid,b.quantity from 
		os_products a inner join os_product_inventory b on a.id=b.pid where b.id=$id")or die(mysql_error());
		
		$s=mysql_fetch_array($get_stock,MYSQL_ASSOC);
		
		$itemDesc="<table>";
		if($s['quantity']>0)
		{
			$itemDesc.="<td valign=top>";
			$itemDesc.="<font class='priceTag'>".$_SESSION['currency_code']." ".number_format($_SESSION['currency_rate']*$s['unit_price'],2)."</font>";	
			$itemDesc.="<input type='hidden' value='".$s['unit_price']."' id='hid_product_price' name='hid_product_price'>";
			
			if($s['show_stock_quantity']==1)
			{
				$itemDesc.="<br><strong><br>Quantity Available : ".$s['quantity']."</strong><br><br>";
			}else{
				$itemDesc.="<br><br><br><br>";
			}
		}
		else
		{
			$itemDesc.="<td valign=top style='background-image:url(\"images/soldout.jpg\");background-position:0 20;background-repeat:no-repeat'>";
			$itemDesc.="<font class='priceTag'>".$_SESSION['currency_code']." ".number_format($_SESSION['currency_rate']*$s['unit_price'],2)."</font>";
			$itemDesc.="<input type='hidden' value='".$s['unit_price']."' id='hid_product_price' name='hid_product_price'>";
								
		}
		
		$itemDesc.="</td></table>";
		echo $itemDesc;
				
?>